package me.stone.stanimeclient.core.ui.item

import kotlinx.coroutines.CoroutineScope
import me.stone.stanimeclient.core.common.di.ApplicationScope
import me.stone.stanimeclient.core.ui.R
import me.stone.stanimeclient.core.ui.binding.item.PlayerBottomMenuItem
import javax.inject.Inject
import javax.inject.Singleton

@Singleton
class AgeBottomMenuHelper @Inject constructor(
    @ApplicationScope private val coroutineScope: CoroutineScope
) {

    val fastValues = listOf(
        0.5f, 0.75f, 1f, 1.5f, 2f
    )

    private val loopPlayValues = listOf(
        "单集循环", "列表循环", "不循环"
    )

    val fast = PlayerBottomMenuItem.createTabsMenu(
        R.drawable.ic_player_fast_forward, "倍速", coroutineScope,
        fastValues.map { "${it}x" }, 2
    )

    val waitSee = PlayerBottomMenuItem.createDescriptionMenu(
        R.drawable.ic_common_inbox, "稍后再看", coroutineScope, ""
    )

    val download = PlayerBottomMenuItem.createEnterMenu(
        R.drawable.ic_common_download, "下载", coroutineScope
    )

    val pic2pic = PlayerBottomMenuItem.createDescriptionMenu(
        R.drawable.ic_player_airplay, "小窗播放", coroutineScope, ""
    )

    val autoPlay = PlayerBottomMenuItem.createSwitchMenu(
        R.drawable.ic_player_skip_forward, "自动播放", coroutineScope, true
    )

    val loopPlay = PlayerBottomMenuItem.createTabsMenu(
        R.drawable.ic_common_refresh_cw, "循环播放", coroutineScope,
        loopPlayValues, 2
    ).apply { showDivider = false }

}